package com.xmall.controller.wx;

import com.xmall.bean.vo.BaseRespVo;
import com.xmall.service.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("wx/catalog")
public class CatalogController {
    @Autowired
    CatalogService catalogService;

    @RequestMapping("current")
    public BaseRespVo showCurrentCatalog(Integer id){
        Map<String,Object> map = catalogService.showCurrentCatalog(id);
        return BaseRespVo.ok(map);
    }

    @RequestMapping("index")
    public BaseRespVo showIndexInCatalog(){
        Map<String,Object> map = catalogService.showIndexInCatalog();
        return BaseRespVo.ok(map);
    }
}
